package test3;

public class Demo4{
    public static void main(String[] args) {
        new Demo4son();
    }

    static {
        System.out.println("父类静态");
    }
    {
        System.out.println("父 class");
    }
    public String name;
    public Demo4(){
        System.out.println("父类默认构造方法");
    }
    public Demo4(String name){

        this.name=name;
        System.out.println("父类构造方法");
    }
}

class Demo4son extends Demo4{
    static {
        System.out.println("子类静态");
    }
    {
        System.out.println("子 class");
    }
    public Demo4son(){
        super("张三");
        System.out.println("子类构造方法");
    }

}